<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@include file="/pageRc/common/common.jsp" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="msapplication-tap-highlight" content="no">
    <script type="text/javascript" src="<%=commonPath %>/pageRc/js/jquery-1.9.1.min.js"></script>
    <link rel="stylesheet" href="<%=commonPath %>/pageRc/layui/css/layui.css" media="all">
    <script type="text/javascript" src="<%=commonPath %>/pageRc/common/utils.js"></script>
    <script type="text/javascript" src="<%=commonPath %>/pageRc/common/msgTool.js"></script>
    <script type="text/javascript" src="<%=commonPath %>/pageRc/layui/layui.js"></script>
    <title>联信科技报工平台-用户更新</title>
    <script type="text/javascript">
        var path = "<%=commonPath%>";
        var msg = new msgTool();
    </script>
</head>
<body>

<div class="main layui-clear">
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class="layui-this">用户更新</li>
            </ul>
            <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding:1.5rem ">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form layui-form-pane">
                        <form method="post">
                            <div class="layui-form-item">
                                <label for="proTeamNo" class="layui-form-label">项目组名称</label>
                                <div class="layui-input-block">
                                    <select name="proTeamNo" id="proTeamNo">
                                        <c:forEach items="${teanList}" var="tean">
                                            <option value="${tean.proTeamNo}"
                                                    <c:if test="${tean.proTeamNo == user.proTeamNo}">selected </c:if>>${tean.proTeamName}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="userName" class="layui-form-label">姓名</label>
                                <div class="layui-input-block">
                                    <input type="text" id="userName" name="userName" required lay-verify="required"
                                           autocomplete="off" class="layui-input" value="${user.userName}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="phoneNo" class="layui-form-label">手机号码</label>
                                <div class="layui-input-block">
                                    <input type="text" id="phoneNo" name="phoneNo" required lay-verify="required"
                                           autocomplete="off" class="layui-input" value="${user.phoneNo}">
                                </div>
                            </div>
                             <div class="layui-form-item">
                                <label for="phoneNo" class="layui-form-label">工作年限</label>
                                <div class="layui-input-block">
                                    <input type="text" id="workYear" name="workYear" required lay-verify="required"
                                           autocomplete="off" class="layui-input" value="${user.workYear}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="state" class="layui-form-label">账号状态</label>
                                <div class="layui-input-block">
                                    <select name="state" id="state">
                                        <c:forEach items="${userStatus}" var="us">
                                            <option value="${us.getValue()}"
                                                    <c:if test="${us.getValue() == user.state}">selected </c:if>>${us.getDesc()}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <input type="hidden" id="userNo" name="userNo" value="${user.userNo}">
                                <button class="layui-btn" style="margin-left: 200px" lay-filter="formUserUpdate" lay-submit>更新</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<script>
    layui.use('form', function () {
        var form = layui.form();
        var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
        form.on('submit(formUserUpdate)', function (data) {
            msg.sendMsg("/page/sys/updateUser.do", data.field, function (data) {
                layer.alert("更新成功！", function () {
                    window.parent.flush();
                    parent.layer.close(index); //执行关闭
                });
            });
            return false;
        });
    });
</script>
</body>
</html>